<meta charset="utf-8"/>

<?php
    $json='[
       {"name":"首页","link":"index.php"},
       {"name":"话题","link":"talk.php"},
       {"name":"发现","link":"found.php"},
       {"name":"呵呵","link":"message.php"}
    ]';
/*
    $new=array();
    $php=(Array)json_decode($json);
    for($i=0;$i<count($php);$i++){
        $new[]=$php[$i];
    }
    print_r($new);
*/
     $php=(Array)json_decode($json);



?>
<html>
<head>
<title>知乎导航条</title>
</head>
    <link rel="stylesheet" type="text/css" href="../dtz.php/2016.10.27.01.css"/>
<body>
    <div id="header">
        <div class="content">
            <div class="logo in-block">知乎</div>

            <div class="search in-block">
                <input type="text" placeholder="搜索你感兴趣的内容..." name="hobby"/>
                <div class="submit in-block">
                    <input name="button" type="submit" value=""/>
                    <div class="img"></div>
                </div>
            </div>

            <div class="nav in-block">
                <ul>
                    <?php     foreach($php as $key=>$value){
                              $value = (array)$value;  
                    ?>
                    <li><a href=""><?php echo $value['name'] ?></a></li>
 
                    <?php }?>
                    <!-- 此处为后台循环输出 -->

                </ul>
            </div>

            <div class="right in-block">
                <div class="question in-block"><a href="">提问</a></div>
                <div class="userinfo in-block">
                    <img src="" />
                    <span><a href="">tingzhi</a></span>
                </div>
            </div>
        </div>
    </div>  

</body>	
</html>